import { Card, Switch } from 'antd';
import classNames from 'classnames';

import { useCurrentNode } from '@/hooks/useCurrentNode';

export const BlockSetting = memo<HTMLElementProps>((props) => {
  const { currentNodeData, setNodeData } = useCurrentNode<any>();

  return (
    <Card size="small" title="节点阻塞配置" className={classNames('block-setting', props.className)}>
      <div className="flex items-center gap-8">
        <div className="text-14">是否阻塞</div>
        <Switch
          value={currentNodeData.blocked}
          onChange={(blocked) => {
            setNodeData({
              ...currentNodeData,
              blocked
            });
          }}
        />
      </div>
    </Card>
  );
});
